home *** CD-ROM | disk | FTP | other *** search
- property enabled, membermin, membermax, cycling, goingup, CurrentState, numstates, name
-
- on getPropertyDescriptionList
- set description to [:]
- addProp(description, #membermin, [#default: 1, #format: #integer, #comment: "Start of Cast Range:"])
- addProp(description, #membermax, [#default: 1, #format: #integer, #comment: "End of Cast Range:"])
- addProp(description, #CurrentState, [#default: 1, #format: #integer, #comment: "Which image to start with:"])
- addProp(description, #cycling, [#default: 1, #format: #boolean, #comment: "Cycling? (if not, bouncing):"])
- addProp(description, #currentImage, [#default: 1, #format: #boolean, #comment: "Going up? (if not, going down):"])
- addProp(description, #name, [#default: #multistate1, #format: #symbol, #comment: "Name:"])
- return description
- end
-
- on getBehaviorDescription
- return "When addressed, cycle through cast members"
- end
-
- on getAssocMembers
- set myPropList to []
- repeat with x = membermin to membermax
- add(myPropList, the name of member x)
- end repeat
- return myPropList
- end
-
- on beginSprite me
- puppetSprite(the spriteNum of me, 1)
- set the enabled of me to 1
- set the numstates of me to the membermax of me - the membermin of me + 1
- setstate(me, the CurrentState of me)
- end
-
- on setgoingup me, value
- set the goingup of me to value
- end
-
- on setcycle me, value
- set the cycling of me to value
- end
-
- on setstate me, statenum
- if the enabled of me then
- if statenum > the numstates of me then
- set statenum to the numstates of me
- end if
- set the member of sprite the spriteNum of me to statenum + the membermin of me - 1
- end if
- end
-
- on bumpstate_extern me, name
- if name = the name of me then
- bumpstate(me)
- end if
- end
-
- on bumpstate me
- if the enabled of me then
- if the cycling of me then
- if the goingup of me then
- set curr to the CurrentState of me + 1
- if curr > the numstates of me then
- set curr to 1
- end if
- else
- set curr to the CurrentState of me - 1
- if curr < 1 then
- set curr to the numstates of me
- end if
- end if
- else
- if the goingup of me then
- set curr to the CurrentState of me + 1
- if curr > the numstates of me then
- set curr to curr - 2
- set the goingup of me to 0
- end if
- else
- set curr to the CurrentState of me - 1
- if curr < 1 then
- set curr to 2
- set the goingup of me to 1
- end if
- end if
- end if
- set the CurrentState of me to curr
- setstate(me, curr)
- end if
- end
-